programming4us
           
 
 
SQL Server

SQL Server 2008 : Security and Compliance - SQL Server Auditing

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
5/27/2011 11:17:53 AM
Introduced with SQL Server 2008 is the SQL Server Audit feature. This long-overdue feature now adds a great native auditing functionality into the SQL Server Database Engine.

Note

The SQL Server Audit feature is available only in the SQL Server 2008 Enterprise and Developer Editions.


An audit is the combination of several elements into a single package for a specific group of server actions or database actions. The components of SQL Server Audit combine to produce an output that is called an audit.

The SQL Server Audit feature in SQL Server 2008 is intended to replace SQL Trace as the preferred auditing solution. SQL Server Audit is meant to provide full auditing capabilities, and only auditing capabilities, unlike SQL Trace, which also serves for performance debugging. The SQL Server Audit feature is built on top of Extended Events, a new high-performance eventing infrastructure introduced in SQL Server 2008. SQL Server Audit leverages the performance benefits of Extended Events, which provides both asynchronous and synchronous write capabilities (by default, SQL Server Audit uses the asynchronous eventing model).

Note

By default, the audit events are written to the audit target in an asynchronous fashion for performance reasons. When tighter guarantees of audit records being written to the audit log are required, you can select synchronous write, with the understanding that some amount of performance degradation should be expected. The choice of asynchronous or synchronous is controlled by the QUEUE_DELAY option of the CREATE AUDIT DDL.


SQL Server Audit is also tightly integrated with the Windows operating systems and can push (write) its audits to the Windows Application or Security Event Log. With SQL Server Auditing, you can set up auditing of just about any event or execution within SQL Server, and it can be as granular as you need (right down to a table and operation level). This capability is important because not only can you track all these events, but you can use this auditing capability to fulfill application and database audit compliance and look for patterns of misuse, or even specific “hot” objects that contain the most sensitive data in your database.

As you can see in Figure 1, a branch under each database called Security contains several of the common security-related nodes that you’ve seen before (Users, Roles, Schemas, and so on). But now, there is a Database Audit Specifications branch from which you can set up and view the database audit specifications you have defined. You can have as many specifications as you want, and again, they can be at varying levels of granularity.

Figure 1. The new Database Audit Specifications item in the SQL Server Management Studio (SSMS) Object Explorer.


Before you can set up a Database Audit Specification, however, you must first set up a SQL Server Audit object. To do this, you must use a couple of new entries in the Object Explorer under the Security folder at the SQL Server instance level: Audits and Server Audit Specifications.

Essentially, three main objects describe audits in SQL Server 2008:

  • The Server Audit object— Used to describe the target for audit data, plus some top-level configuration settings. This destination can be a file, the Windows Application log, or the Windows Security log. The Server Audit object contains no information about what is being audited—just where the audit data is going. Multiple Server Audit objects can be defined with each object independent from one another (that is, they can each specify a different destination).

  • The Server Audit Specification object— Used to describe what to audit at a server instance-wide level. A server audit specification must be associated with a Server Audit object to define where the audit data is written. There is a one-to-one relationship between the Server Audit Specification object and the Server Audit object.

  • The Database Audit Specification— Used to describe what to audit at a specific database level. Where the audit data is written is determined by the Server Audit object it is associated with. Each database audit specification can be associated with only one server audit. A server audit can be associated with audit specifications for multiple databases, but only one database audit specification per database.

To create a new Server Audit object, right-click on the Audits item in Object Explorer and select New Audit (see Figure 2).

Figure 2. Creating a new Server Audit object in Object Explorer at the Server instance level.

When you set up a Server Audit object, you specify where the audit information will be written to. In Figure 3, you can see that we are creating a server audit named NEW_SQL_Server_Audit and are defining it to use the Application log at the Windows operating system level as the audit destination. You can also choose to write to the Windows Security log or to a text file. Events written to the Application or Security Event log can be accessed with Event Viewer or with specialized Event log management software, such as Microsoft Systems Center Operations Manager.

Figure 3. The Create Audit dialog.

Note

Depending on the volume of audit targets being monitored, better performance may be achieved by using a file as the audit target rather than the Windows Event log. Also, when written to a file, the audit data is accessible through a built-in table-valued function (fn_get_audit_file), which allows the use of regular SELECT syntax to query the audit trail.


Note

You can also configure the Audit object to shut down the SQL Server instance if, for whatever reason, SQL Server Audit is unable to write its audit events to the audit target. Although shutting down the server instance may seem drastic, doing so may be necessary for certain scenarios, to ensure that the server cannot operate without its activity being audited.


After you set up the Server Audit object, the next step is to go to the Database Audit Specifications folder, as shown in Figure 1, in the database for which you want to set up auditing. Right-click this folder and select New Database Audit Specification to bring up the dialog shown in Figure 4. This is where you define your database-level audits.

Figure 4. The Create Database Audit Specification dialog.

In the Create Database Audit Specification dialog, you specify the name of the Database Audit object and the Server Audit object it will be running under. In this example, the Database Audit name is NEW_Database_Audit_Specification, and it will be running under the NEW_SQL_Server_Audit Audit object defined in Figure 13.9. In this example, the database audit is being set up to audit any SELECT statements (reads) run against the Employee table (which, of course, contains company-sensitive employee data) by any user (public).

At this point you have created a Server Audit object and database audit specification associated with the server audit. However, neither of these audits is enabled. You can enable them by right-clicking on each and selecting Enable. As soon as the Server Audit object is enabled, it begins auditing and writing audit records to the specified destination (in this example, the Windows Application log).

Note

If your SQL Server login is configured for a default database other than master, enabling the SQL Server Audit object via SSMS fails with the following message:

Cannot alter a server audit from a user database. This operation must be
performed in the master database.

You can review the details by right-clicking on the Server Audit and selecting View Audit Logs or, if you are auditing to the Windows Application or Security Event Log, by opening the Windows Event Viewer directly. One of the advantages of opening the Audit log from within SSMS is that it automatically filters the log to show only SQL Server Audit events. In Figure 5, you can see that we’ve opened the Log File Viewer and selected to view the Application log (where we directed our SQL Server Audit to go). A few SELECT statements were run against the Employee table and, sure enough, the audit information of the SELECT statements shows up in the Application log.
Figure 5. Log File Viewer showing the audit events of a SQL Server Audit object.

Within the Log File Viewer, you can filter your audit results or search them to look for patterns, specific violations, and so on. From the Log File Viewer, you also have the option of exporting the audit logs to a text file or to a comma-separated values (CSV) file. With a CSV file, you could import the audit logs into a database for further analysis and correlation. It’s up to your security and audit team to decide how these audits are to be used.

In addition to database-level auditing of actions at the database level, you can also set up auditing of server-level events, such as management changes and logon and logoff operations. These are set up in the SSMS Object Explorer through the Server Audit Specifications item in the Security folder for the SQL Server instance.

Other -----------------
- SQL Server 2008 : Security and Compliance
- SQL Server 2008 : Transparent Data Encryption
- SQL Server 2008 : Data Encryption - Column-Level Encryption
- SQL Server 2008 : Data Encryption - SQL Server Key Management
- SQL Server 2008 : Data Encryption
- SQL Server 2008 : Client Data Access Technologies
- SQL Server 2008 : Client Configuration
- SQL Server 2008 R2 : Client Installation
- SQL Server 2008 R2 : Client and Server Networking Considerations
- Upgrading to SQL Server 2008 : Upgrading Other SQL Server Components
- Upgrading to SQL Server 2008 : Slipstreaming Upgrades
- Upgrading to SQL Server 2008 : Upgrading Using a Configuration File
- Destination: SQL Server 2008 or SQL Server 2008 R2 (part 2) - Upgrading In-Place
- Destination: SQL Server 2008 or SQL Server 2008 R2 (part 1) - Side-by-Side Migration
- Upgrading to SQL Server 2008 : Using the SQL Server Upgrade Advisor (UA)
- SQL Server 2008 : Developing Custom Managed Database Objects (part 7) - Using Transactions & Using the Related System Catalogs
- SQL Server 2008 : Developing Custom Managed Database Objects (part 6) - Developing Managed Triggers
- SQL Server 2008 : Developing Custom Managed Database Objects (part 5) - Developing Managed User-Defined Aggregates
- SQL Server 2008 : Developing Custom Managed Database Objects (part 4) - Developing Managed User-Defined Types
- SQL Server 2008 : Developing Custom Managed Database Objects (part 3) - Developing Managed User-Defined Functions
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us